<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="__CSS__/supplies/bootstrap.min.css">
    <link rel="stylesheet" href="__CSS__/supplies/common.css">
    <style>
        html,body{
            font-family: '微软雅黑';
        }
        html,body{overflow: hidden}

        body{
            /*background-color: #FEECDE;*/
            background: url("/image/xhl_yy_bg.jpg");
            background-size: 100% 100%;
            background-repeat: no-repeat;
            font-size: 14px;
        }
        .reg_content{
            width: 432px;
            height: 426px;
            border: 1px solid #FEF8EF;
            background-color: #FFFCF9;
            margin: auto;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            -moz-box-shadow:0px 0px 40px rgba(243,188,145,0.2);
            -webkit-box-shadow:0px 0px 40px rgba(243,188,145,0.2);
            box-shadow:0px 0px 40px rgba(243,188,145,0.2);
        }
        .reg_left_from{
            width: 100%;
            height: 100%;
        }
        .form_title{
            text-align: center;
            padding-top: 40px;
            color: #333;
            font-size: 24px;
        }
        .form_content{
            margin-top:50px;
            padding: 0 50px;
        }
        .user_name{
            position: relative;
            width: 260px;
            margin: 0 auto;
        }
        .input_div{
            position: relative;
            width: 100%;
            margin-bottom: 30px;
        }
        .input_div span{
            margin-right: 10px;
            width: 55px;
            height: 100%;
            text-align: right;
        }
        input{
            width: 260px;
            height: 44px;
        }
        .commint_btn{
            width: 330px;
            margin: 60px auto;

        }
        a{
            /*color: #6E6A67;*/
            out-line: none;
        }
        a:hover{
            text-decoration: none;
            /*color: #6E6A67;*/
        }
        a:visited{
            text-decoration: none;
            /*color: #6E6A67;*/
        }
        a:active{
            text-decoration: none;
            /*color: #6E6A67;*/
        }
        a:focus{
            text-decoration: none;
            /*color:#000;*/
        }
        .select_a{
            text-decoration: none;
            display: block;
            height: 44px;
            text-align: center;
            color: white;
            out-line: none;
            border: 1px solid #5bc0de;
            line-height: 44px;
            background: #5bc0de;
            color: white;
        }

        .select_a:hover{
            text-decoration: none;
            color: white;
            /*background-color: #BDBDBD;*/
        }
        .select_a:visited{
            text-decoration: none;
            /*color: white;*/
        }
        .select_a:active{
            text-decoration: none;
            /*color: white;*/
        }
        a:focus{
            text-decoration: none;
            color:white;
        }
    </style>
</head>
<body onkeydown="login()">
<div class="reg_content form-inline" style="z-index: 9999">
    <div class="reg_left_from form-group" id="passwordlogin">
        <div class="form_title" style="font-size: 26px;line-height: 24px;color: #333;">
            登录
        </div>
        <div class="form_content">
            <div class="user_name input_div form-inline">
                <span class="form-group">用&nbsp;戶&nbsp;名:</span>
                <input type="text" id="phone" class="tel form-group" isvalid="yes" placeholder="请输入用户名"/>
            </div>
            <div class="password input_div form-inline">
                <span class="form-group">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:</span>
                <input type="password" isvalid="yes" class="pwd form-group" style="" placeholder="请输入密码" />
                <!--<div style="margin-top: 9px;overflow:hidden;cursor: pointer">-->
                    <!--<div style="font-size: 12px;float: right;color:#333;margin-right: 12%;" onclick="herf('resetPassword')">忘记密码？</div>-->
                <!--</div>-->
            </div>
            <div class="commint_btn">
                <a class="select_a font_size_14" style="cursor:pointer;font-size: 16px;">登&nbsp&nbsp录</a>
            </div>
        </div>
    </div>
</div>
</body>
<script rel="script" src="__JS__/supplies/jquery.min.js"></script>
<!--<script rel="script" src="__JS__/supplies/jquery-3.2.1.min.js"></script>-->
<script rel="script" src="__JS__/supplies/validator/validator.js"></script>
<script rel="script" src="__JS__/supplies/layer/layer.js"></script>
<script>
    //提交
    $('.commint_btn').click(function(){
        $tel =  $('.tel').val();
        $password =  $('.pwd').val();
        if('' == $tel || '' == $password){
            layer.msg('请输入用户名或密码');
        }else{
            $.ajax({
                type: "POST",
                url: "{:url('admin/User/login')}",
                cache: false,
                data: {admin_name: $tel, password: $password},
                dataType: "json",
                success: function (data) {
                    if (200 == data['status']) {
                        location.href = "{:url('admin/Index/index')}";
                    }
                    else
                    {
                        layer.msg(data.msg);
                    }
                }
            });
        }
    })
    function login(){
        if (event.keyCode==13){
        $tel =  $('.tel').val();
        $password =  $('.pwd').val();
        if('' == $tel && '' == $password){
            layer.msg('请输入用户名和密码');
        }else{
            $.ajax({
                type: "POST",
                url: "{:url('admin/User/login')}",
                cache: false,
                data: {admin_name: $tel, password: $password},
                dataType: "json",
                success: function (data) {
                    if (200 == data['status']) {
                        location.href = "{:url('admin/Index/index')}";
                    }
                    else
                    {
                        layer.msg(data.msg);
                    }
                }
            });
        }
        }
    }
</script>
</html>